<div class="jumbotron">
	<?php 
	if ($this->session->userdata('send_as_staff')) {
		echo $this->session->userdata('send_as_staff');
		$this->session->unset_userdata('send_as_staff');
	} else if ($this->session->userdata('send_success')) {
		echo $this->session->userdata('send_success');
		$this->session->unset_userdata('send_success');
	}
	?>
	<div id="frm">
		<div id="tb1"><p class="txt_tb1">LEAVE AND EXTRA HOUR REQUEST FORM</p></div></br>
		<?php
		foreach ($datas->result() as $rows) {
			//$nameemloyee =$rows->staff_id;
			$fname = $rows->emp_fname;
			$lname = $rows->emp_lname;
			$em_id = $rows->emp_id;
			$dep_name = $rows->dept_name;
//			$grp_name = $rows->grp_name;
		}
		$personal = 0;
		$org = 0;
		foreach ($total->result() as $rows) {
			$type_id = $rows->lea_id;
			$id = $rows->duration;

			if ($type_id == 1) {
				$personal = $id + $personal;
			} else if ($type_id == 2) {
				$org = $id + $org;
			}
		}
		$result_hour = $personal * 8;
		$org_hour = $org * 8;
		$totals_date = $personal + $org;
		$less_date = PNC_Controller::DAYOFF - $totals_date;
		$less_time = $less_date * 8;
		?>
		<table style="width:100%;">
			<tr>
				<td>
					<table style="width:400px;">
						<tr>
							<td>Employee 's Name </td>
							<td>:</td>
							<td><?php echo '<strong>' . $fname . ' ' . $lname . '</strong>'; ?></td>
						</tr>
						<tr>
							<td>Employee 's ID </td>
							<td>:</td>
							<td> <?php echo '<strong>' . $em_id . '</strong>'; ?></td>
						</tr>
						<tr>
							<td>Department</td>
							<td>:</td>
							<td><?php echo '<strong>' . $dep_name . '</strong>'; ?></td>
						</tr>
<!--						<tr>
							<td>Group           </td>
							<td>:</td>
							<td><?php echo '<strong>' . $grp_name . '</strong>'; ?></td>
						</tr>-->
					</table>
				</td>
				<td>
					<table style="float:right; margin-right:50px;" >
						<tr>
							<td>Semastrail Paid Leave</td>
							<td>:</td>
							<td><strong id="num"><?php echo PNC_Controller::DAYOFF; ?></strong> Days/Year</td>
						</tr>
						<tr>
							<td>Remainded from second semester</td>
							<td> : </td>
							<td> <strong id="num"><?php echo $totals_date; ?> </strong> Days</td>
						</tr>

						<tr>
							<td>Total Paid Leave Remained</td>
							<td>:</td>
							<td><strong id="num"> <?php echo $less_date; ?></strong> Days</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>

		<div id="tb2"><p style="padding:10px 380px;"><b>កាឈប់សម្រាក់ប្រចាំឆមាស/per semester leave Record</b></p></div>
		<table class="table table-bordered"><br />
			<tr class="info">
				<td width="350" height="40"><b>ប្រភេទនៃកាឈប់សម្រាក់ / Type of Leave</b></td>
				<td width="300"><b>ចំនួនថ្ងៃសម្រាក់សរុប / Leave Cedits</b></td>
				<td width="200"><b>ចំនួនស្នើរសុំ / Requested</b></td>
				<td width="200"><b>សមតុល្យ / Balance</b></td>
			</tr>
			<tr>
				<td width="350" height="30">ឈប់សម្រាក់ដោយអង្កាតម្រូវ/Impossed Leave</td>
				<td rowspan="2" ><p style=" margin-top:27px;margin-left:90px;"><font color="red" style="font-weight:bold;"><?php echo PNC_Controller::DAYOFF; ?></font> days</p> </td>
				<td><b style="margin-left:20px;" id="num"><?php echo $org; ?>
					</b> days Equal =<b id="num"> <?php echo $org_hour; ?> </b>hours</td>
				<td rowspan="2" width="350" ><p style="; margin-top:27px;"><b id="num"><?php echo $less_date; ?></b> days  Equal = <b id="num"><?php echo $less_time; ?></b> hours</p></td>
			</tr>
			<tr>
				<td width="350" height="30">ការឈប់សម្រាក់ផ្ទាល់ខ្លួន/Personal Leave</td>
				<td width="350"><b style="margin-left:20px;" id="num"><?php echo $personal; ?></b> days  Equal = <b id="num"><?php echo $result_hour; ?></b> hours</td>

			</tr>
		</table>
		<div id="tb3"><p style="padding:10px 450px; font-weight:bold;">ការឈប់សម្រាក់ពិសេស/Special Leave</p></div>
		<table class="table table-bordered">

			<table class="table table-bordered"   >
				</tr>
				<tr class="info">
					<td  width="320px" height="40"><b>ប្រភេទនៃការឈប់សម្រាក់ / Type of Leave</b></td>
					<td width="265px" ><b>ចំនួននៃថ្ងៃឈប់សម្រាក់ / Leave Credits</b></td>
					<td width="280px"><b>ចំនួនស្នើរសុំសមតុល្យ/ Requested</b></td>
					<td ><b>សមតុល្យ / Balance</b></td>
				</tr>
				<tr>
					<td  height="30">មរណះភាពក្រុមគ្រួសារខ្លួន / Deat of Oun Parent</td>
					<td ><b id="num">3</b> days /​ <b id="num">៣</b> ថ្ងៃ</td>
					<td ><b id="num">0</b> days and <b id="num">0</b> hours Equal = <b id="num">0</b> Hours</td>
					<td ><b id="num">3</b> days and <b id="num">0</b> hours Equal = <b id="num">២៤</b> Hours</td>
				</tr>
				<tr>
					<td  height="30">បិតុភាព / Paternity Leave</td>
					<td ><b id="num">2 </b>days /  <b id="num">២</b> ថ្ងៃ</td>
					<td >Not Eligible for Paternity Leave</td>
					<td ><b id="num">0 </b>days and <b id="num">0</b> hour Equal = <b id="num">0</b> days</td>
				</tr>
				<tr>
					<td  height="30">​មាតុភាព / Maternity Leave</td>
					<td><b id="num">90</b> days / <b id="num">៩០</b> ថ្ងៃ</td>
					<td><b id="num">0</b> days and <b id="num">0</b> hours Equal = <b id="num">0</b> Hours</td>
					<td><b id="num">90</b> days and <b id="num">0</b> hour Equal = <b id="num">៧២០</b> Hours</td>
				</tr>
				<tr>
					<td  height="30"> រៀបអាពាហ៏ពិពាហ៏ / Own's Leave​ </td>
					<td ><b id="num">3</b> days /<b id="num">៣</b> ថ្ងៃ</td>
					<td ><b id="num">0</b> days and <b id="num">0</b> hours Equal = <b id="num">0</b> Hours</td>
					<td ><b id="num">3</b> days and <b id="num">0</b> hours Equal = <b id="num">២៤</b> Hours</td>
				</tr>
				<tr>
					<td  height="30">រៀបអាពាហ៏ពិពាហ៏កូនបង្កើត / Child's Wedding</td>
					<td ><b id="num">2</b> days / <b id="num">២</b> ថ្ងៃ</td>
					<td ><b id="num">0</b> days and<b id="num">0</b> hours Equal = <b id="num">0</b> Hours </td>
					<td ><b id="num">2</b> days and <b id="num">0</b> hours Equal = <b id="num">១៦</b> Hours</td>
				</tr>
				<tr>
					<td  height="30"> ការឈប់សម្រាក់ដោយជម្ងឺ / Medical / Sick Leave</td>
					<td><b id="num">15</b> days / <b id="num">១៥</b> ថ្ងៃ</td>
					<td><b id="num">0</b> days and <b id="num">0</b> hours Equal = <b id="num">0</b> Hours</td>
					<td><b id="num">15</b> days and <b id="num">0</b>hours Equal = <b id="num">១២០</b> Hours</td>
				</tr>

			</table><br />
	</div>
</div>